home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tlxjwpc5.zip / RBBSN3.SLT < prev    next >
Text File  |  1990-09-21  |  8KB  |  268 lines

  1. //╔═════════════════════════════════════════════════════════════════════╗
  2. //║ RBBS 17.3A         JW-PC Consulting DataFlex.HST      (608)837-1923 ║
  3. //║ Dual Std HST/V.32/MNP5/V.42     RBBSnet 8:972/2     FIDOnet 1:121/8 ║
  4. //╚═════════════════════════════════════════════════════════════════════╝
  5. // RBBSN3.SLT  by Jim Wargula, Sysop of JW-PC DataFlex.HST, 09-20-90.
  6. // This is a sample TELIX script for logging on to JW-PC DataFlex.HST.
  7. // It will log in, download SMLNET sequence list new messages, and start
  8. // to read main base messages.  The name of the bbs will show on the
  9. // status line.
  10.  
  11. str user_name[30] = "YOUR NAME ";
  12.  
  13. // Put your name in the above line. The script will get the proper password
  14. // from the dialing directory (Telix puts that password in the script system
  15. // variable called _entry_pass).  Use spaces as in example!
  16. // Before using this script for the first time, or when you make a change,
  17. // type 'cs rbbsn3' at the DOS prompt to compile the script for use by Telix.
  18.  
  19. //////////////////////////////////////////////////////////////////////////////
  20. //  globals
  21. //
  22.  
  23. // used by showname():
  24. //
  25. int       statline =  24;                     // Telix status line row
  26. int       statback =   7;                     // status line background color
  27. int       statfore =   0;                     // status line foreground color
  28.  
  29. str       failed[] = "Logon failed.";
  30.  
  31. // DSZ stuff
  32. str dsz[80]  =
  33.   "c:\util\DSZ port ";
  34.  
  35. str upld[31]  =
  36.   " pW1 pB4096 ha sl sz -b -m -rr ";
  37.  
  38. str dnld[31]=
  39.   " pW1 pB4096 ha sl rz -b -m -rr ";
  40.  
  41. str port[1];
  42.  
  43. //////////////////////////////////////////////////////////////////////////////
  44. //  main routine
  45. //
  46. main()
  47. {
  48.  int stat;
  49.  
  50.  int t1, t2, t3, t4, t5, t6, t7, t8, t9;
  51.  
  52.  int tmark;
  53.  
  54.  alarm(1);                              // connect!
  55.  itos(get_port(),port);
  56.  showname();
  57.  
  58.  if (not _entry_pass)                   // no pass, so didn't recog. board
  59.   {
  60.    prints ("Sorry, I don't know the password for this BBS!");
  61.    return;
  62.   }
  63.  strcat (user_name, _entry_pass);       // build name for turbo login
  64.  strcat (user_name, " !");
  65.  
  66.  t1 = track ("ontinue", 1);            // define tracks
  67.  t2 = track ("First name?", 1);
  68.  t3 = track (" ([Y],N", 1);
  69.  t4 = track (">? ", 1);
  70.  t5 = track ("Name ->", 1);
  71.  t6 = track ("Type ->", 1);
  72.  t7 = track (" (Y/[N]", 1);
  73.  t8 = track ("(A,Y,[N])", 1);
  74.  t9 = track ("**", 1);
  75.  
  76.  delay_scr (80);                        // wait 8 seconds for front end
  77.  cputs ("^[");                          // send escape to wake bbs up!
  78.  
  79.  tmark = timer_start (6000);            // wait up to 10 minutes for login Part I
  80.  
  81. //////////////////////////////////////////////////////////////////////////////
  82. //  Loop I - Login, open NET door, extract messages.
  83. //
  84.  
  85.  while (not time_up (tmark))
  86.   {
  87.    terminal();                          // let Telix process any chars and keys
  88.  
  89.    stat = track_hit (0);                // see which (if any) track was hit
  90.  
  91.    if (stat == t1)                      // respond to Key to continue
  92.     {
  93.      delay (5);
  94.      cputs ("^M");
  95.     }
  96.    else if (stat == t2)                 // send name and password
  97.     {
  98.      cputs (user_name);
  99.      cputs ("^M");
  100.     }
  101.    else if (stat == t3)                 // send "NO"
  102.     {
  103.      cputs ("n^M");
  104.     }
  105.  
  106.               ////////////////////////// comment out or delete section of code
  107.               ////////////////////////// between these and comment bars below
  108.               ////////////////////////// for standard login - no netmail called
  109.  
  110.    else if (stat == t4)                 // main menu...
  111.     {
  112.      delay (2);
  113.      cputs ("d net^M");                 //open Net Door
  114.     }
  115.    else if (stat == t5)                 //net conference menu...
  116.     {
  117.      delay (2);
  118.      cputs ("q^M");                     //get function menu
  119.     }
  120.    else if (stat == t6)                 //start new extract
  121.     {
  122.      delay (2);
  123.      cputs ("n^M");
  124.     }
  125.    else if (stat == t7)                 //select sequence list
  126.     {
  127.      delay (2);
  128.      cputs ("n^M");
  129.     }
  130.    else if (stat == t8)                 //extract all sequence conferences
  131.     {
  132.      delay (2);
  133.      cputs ("a^M");
  134.      break;                             //goto next section tracking
  135.     }
  136.   }
  137.  
  138.  if (time_up (tmark))
  139.     {
  140.     prints ("Part I failed!");
  141.     return;
  142.     }
  143.  
  144.  timer_free (tmark);                    // free timer channel
  145.  
  146.  tmark = timer_start (12000);           // wait up to 20 minutes for login Part II
  147.  
  148. //////////////////////////////////////////////////////////////////////////////
  149. //  Loop II -  Download extract file
  150. //
  151.  
  152.  while (not time_up (tmark))
  153.   {
  154.    terminal();                          // let Telix process any chars and keys
  155.  
  156.    stat = track_hit (0);                // see which (if any) track was hit
  157.  
  158.    if (stat == t1)                      // respond to continue
  159.     {
  160.      delay (5);
  161.      cputs ("^M");
  162.     }
  163.    else if (stat == t6)                 // download extract file
  164.     {
  165.      delay (5);
  166.      cputs ("d z z^M");
  167.     }
  168.    else if (stat == t9)                 // call zmodem
  169.     {
  170.      strcat(dsz,port);
  171.      strcat(dsz,dnld);
  172.      strcat(dsz,_down_dir);             //using ZmodemMobyturbo
  173.      dos(dsz,0);
  174.     }
  175.    else if (stat == t7)                 //select sequence list
  176.     {
  177.      delay (2);
  178.      cputs ("y^M");
  179.      break;                             //goto next section tracking
  180.     }
  181.  }
  182.  if (time_up (tmark))
  183.     {
  184.     prints ("Part II failed!");
  185.     return;
  186.     }
  187.  
  188.  timer_free (tmark);                    // free timer channel
  189.  
  190.  tmark = timer_start (1800);           // wait up to 3 minutes for login Part III
  191.  
  192. //////////////////////////////////////////////////////////////////////////////
  193. //  Loop III - Exit NET door, read messages
  194. //
  195.  
  196.  while (not time_up (tmark))
  197.   {
  198.    terminal();                          // let Telix process any chars and keys
  199.  
  200.    stat = track_hit (0);                // see which (if any) track was hit
  201.  
  202.    if (stat == t6)                      // good-bye to SMLnet door
  203.     {
  204.      delay (5);
  205.      cputs ("g^M");
  206.     }
  207.  
  208.               ////////////////////////// comment out or delete section of code
  209.               ////////////////////////// between these and comment bars above
  210.               ////////////////////////// for standard login - no netmail called
  211.  
  212.    else if (stat == t4)                 // main menu back
  213.     {
  214.      cputs ("r s^M");
  215.      break;                             // read msgs & done
  216.     }
  217.   }
  218.  
  219. //////////////////////////////////////////////////////////////////////////////
  220. //  End  - Clean-up
  221. //
  222.  
  223.  if (time_up (tmark))
  224.     {
  225.     prints ("Part III failed!");
  226.     return;
  227.     }
  228.  
  229.  timer_free (tmark);                    // free timer channel
  230.  track_free (0);                        // and all track channels
  231.  alarm (5);                             // sound alarm, we're there!
  232. }
  233.  
  234. //////////////////////////////////////////////////////////////////////////////
  235. //  Function:     showname
  236. //  Description:  Displays the name of the system you're connected to, or
  237. //                "Alt-Z for Help" if you're not connected to anything.
  238. //
  239. //                You can plug this into ANY logon script file, just call it
  240. //                as shown in main().
  241. //
  242. //                This routine will overwrite the "Alt-Z for Help" message,
  243. //                but I think it's worth it.  If you don't like this feature,
  244. //                set the Anonymous option in SLCONFIG to 'y' (YES).
  245. //  Parameters:   none
  246. //  Returns:      nothing
  247. //
  248. showname()
  249. {
  250.   str       name[14];                         // name to display
  251.   int       x, y;                             // old cursor position
  252.  
  253.   x = getx();                                 // save current position
  254.   y = gety();                                 //
  255.  
  256.   substr(_entry_name, 0, 14, name);           // get the current BBS name
  257.   if ((strlen(name) == 0) || (! carrier()))   // no name or not connected?
  258.     name = "Alt-Z for Help";                  //   then display help message
  259.  
  260.   strcat(name, "              ");             // pad name with spaces
  261.  
  262.   pstraxy( name, 1, statline,                 // display it
  263.            (statback * 16) + statfore
  264.          );
  265.  
  266.   gotoxy(x, y);                               // return to saved position
  267. }
  268.